#@adminLayout() #define main()

<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="type-form">
					<div class="select-list">
						<ul>
							<li>名称：<input type="text" name="cname" />
							</li>

							<li class="select-time"><label>创建时间： </label> <input
								type="text" class="time-input" id="startTime" placeholder="开始时间"
								name="beginTime" /> <span>-</span> <input type="text"
								class="time-input" id="endTime" placeholder="结束时间"
								name="endTime" /></li>
							<li><a class="btn btn-primary btn-rounded btn-sm"
								onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm"
								onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>

			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()"> <i
					class="fa fa-plus"></i> 新增
				</a>
				<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" >
		            <i class="fa fa-edit"></i> 修改
		        </a> -->
				<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">
		            <i class="fa fa-remove"></i> 删除
		        </a> -->
			</div>

			<div class="col-sm-12 select-table table-bordered">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>

	<script type="text/javascript">
		var prefix = "#(ctx)/sysorginfo";

		$(function() {
			var options = {
				url : prefix + "/list",
				createUrl : prefix + "/add",
				updateUrl : prefix + "/edit?id={id}",
				removeUrl : prefix + "/remove",
				uniqueId : "ccode",
				sortName : "cname",
				sortOrder : "desc",
				modalName : "类型",
				columns : [
						{
							checkbox : true
						},
						{
							title : '操作',
							align : 'center',
							width : '100px',
							formatter : function(value, row, index) {
								var actions = [];
								actions
										.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="edit(\''
												+ row.ccode
												+ '\',\'edit\')"><i class="fa fa-edit"></i>编辑</a> ');
								/* actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.ccode + '\')"><i class="fa fa-remove"></i>删除</a>'); */
								return actions.join('');
							}
						},
						{
							title : '序号',//标题  可不加,
							width : '60px',
							formatter : function(value, row, index) {
								return index + 1;
							}
						},
						{
							field : 'ccode',
							title : '编码',
							sortable : true,
							width : '90px'
						},
						{
							field : 'cname',
							title : '企业名称',
							sortable : true,
							width : '150px'
						},
						{
							field : 'cproname',
							title : '项目名称',
							sortable : true,
							width : '150px'
						},
						{
							field : 'logo_src',
							title : '图片',
							width : '150px',
							formatter : function(value, row, index) {
								return $.table.imageView('#(webServer)/upload/'
										+ value, 300, 500);
							}
						}, {
							field : 'address',
							title : '地点',
							width : '150px'
						}, {
							field : 'cmanager',
							title : '负责人',
							width : '150px'
						}, {
							field : 'nmax_cd',
							title : '允许测点数',
							width : '150px'
						},  {
							field : 'cphone',
							title : '联系电话',
							width : '150px'
						},  {
							field : 'ip_dcs',
							title : 'DCS网关',
							width : '150px'
						},  {
							field : 'ip_das',
							title : 'DAS网关',
							width : '150px'
						},  {
							field : 'db_type',
							title : '时序数据库类型',
							width : '150px'
						}, {
							field : 'limitstart',
							title : '有效开始时间',
							sortable : true,
							width : '150px'
						}, {
							field : 'limitend',
							title : '有效结束时间',
							sortable : true,
							width : '150px'
						} ]
			};
			$.table.init(options);

			$("#bootstrap-table").colResizable({
				liveDrag : true,
				gripInnerHtml : "<div class='grip'></div>",
				draggingClass : "dragging",
				resizeMode : 'overflow'
			});
		});

		function edit(ccode, ctype) {
			$.modal.open("修改产权信息", prefix + "/edit?id=" + ccode + "&ctype="
					+ ctype);
		}
	</script>
</body>
#end
